﻿@{
    Layout = null;
    var plugName = @user.admin.cyt369.com.Areas.UserAdmin.Models.PlugName.Name;
    var tableName = PageViewModel.PageTableID(this, plugName);
    var tableToolBar = PageViewModel.PageTableToolbar(this, plugName);
    var tableToolBarSearch = PageViewModel.PageTableToolbarSearch(this, plugName);
    var tableToolBarReset = PageViewModel.PageTableToolbarReset(this, plugName);

}
<div style="height:100%">
    <script type="text/javascript">
    function @tableToolBarSearch {
        $('#@tableName').datagrid('load', {
            LoginName: $("#@tableToolBar").find("#LoginName").textbox("getValue"),
        });
    }

    function @tableToolBarReset {
        $("#@tableToolBar").find("#LoginName").textbox("setValue", "");
       @tableToolBarSearch;
    }
    </script>
    <!-- -->
    <table id="@tableName" class="easyui-datagrid" style="width:100%" rownumbers="true" fitColumns="true" fit="true"
           pagination="true" pageSize="@SystemSettingService.Instance.PageSize" pageList="@SystemSettingService.Instance.PageList"
           data-options="striped:true,border:false,singleSelect:true,url:'~/@plugName/Users/GetUserLoginLogs',method:'get',toolbar:'#@tableToolBar'">
        <thead>
            <tr>
                <th data-options="field:'UserID',width:100,formatter:function(v,r,i){
                    var u = GetObject(v, '~/@plugName/Users/GetUserByID');
                    if(u != null) {
                        r.FullName = u.FullName;
                        return u.UserName;
                    }
                }">登录名</th>
                <th data-options="field:'FullName',width:100">全名</th>
                <th data-options="field:'AppID',width:100,formatter:function(v,r,i){
                    var u = GetObject(v, '~/@plugName/App/GetAppByID');
                    if(u != null) { return u.Name; }
                }">系统</th>
                <th data-options="field:'IPAddress',width:100,align:'center'">IP</th>
                <th data-options="field:'Privince',width:100">登录位置</th>
                <th data-options="field:'City',width:100">登录位置</th>
                <th data-options="field:'Platform',width:100">平台</th>
                <th data-options="field:'Browser',width:100">浏览器</th>
                <th data-options="field:'Version',width:100">版本</th>
                <th data-options="field:'IsMobileDevice',align:'center',formatter:$.CheckdFormat" width="70">移动设备</th>
                <th data-options="field:'MobileDeviceModel',width:100">设备</th>
                <th data-options="field:'MobileDeviceManufacturer',width:100">设备厂商</th>
                <th data-options="field:'LoginTime',width:100,align:'center',formatter:$.DateTimeFmt">登录时间</th>
            </tr>
        </thead>
    </table>
    <div id="@tableToolBar" class="easyui-panel table-toolbar">
        <ul class="query-body">
            <li>
                <span>登录名：</span>
                <input id="LoginName" class="easyui-textbox" />
            </li>
            <li>
                <a href="javascript:@tableToolBarSearch" class="easyui-linkbutton" data-options="iconCls:'icon-search'">查询</a>
                <a href="javascript:@tableToolBarReset" class="easyui-linkbutton" data-options="iconCls:'icon-reload'">重置</a>
            </li>
        </ul>
    </div>
</div>